<template>
  <div class="task-container">
    <task-item
      v-for="task in tasks"
      :key="task.id"
      v-bind="task"
      @preview-click="onPreview"
      @assign-click="onAssign"
      @check-click="onCheck"
    />
    <slot></slot>
  </div>
</template>

<script>
import TaskItem from "./TaskItem.vue";

export default {
  components: { TaskItem },
  props: {
    tasks: {
      type: Array,
      required: true,
    },
    filter: {
      search: '',
      language_name: 1,
      type: Object,
      default: () => ({}),
    }
  },
  computed: {

  },
  methods: {
    onPreview(id) {
      this.$emit('preview', id);
    },
    onAssign(id) {
      this.$emit('assign', id);
    },
    onCheck(id) {
      this.$emit('check', id);
    }
  }
}
</script>

<style scoped>
.task-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
</style>